package com.psp.web.persist.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.psp.web.model.ServiceBean;
import com.psp.web.persist.dao.ServiceDao;

@Repository
public class ServiceImpl extends BaseImpl implements ServiceDao {
	final String NAME_SPACE = NAME_SPACE_HEADER + ".ServiceMapper";

	@Override
	public List<ServiceBean> selectServiceList(int start, int limit) {
		Map<String, Object> params = new HashMap<>();
		params.put("start", start);
		params.put("limit", limit);

		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectList2Provider", params);
	}

	@Override
	
	public int selectTotalCount() {
		Integer temp = sqlSessionTemplate.selectOne(NAME_SPACE + ".selectCount");
		return temp == null ? 0 : temp;
	}

}
